package distributedbank.fdservice;

/**
 * The FDVoter works as Transmitter that collects SuspectRequests from the
 * Sensors, send them to FDService, get responses from FDService, and broadcast
 * any change to the components (both bank branches and clientGUIs), as what the
 * Oracle did in Phase 3.
 * 
 * Globally unique.
 */
public class FailureDetectionVoter {

	public FailureDetectionVoter() {
		this.run();
	}

	/**
	 * Listen to 
	 * 		SuspectRequest from Sensor.
	 * 		Enqueue the Request.
	 * 		Broadcast VoterRequest to FDServers.
	 * Listen to 
	 * 		FDServerResponse from FDServer.
	 * 		Check the ResponseId if the corresponding Request is in record. 
	 * 		If a Request gets 4 = ((7+1)/2) Responses with same value,
	 * 			Broadcast the live-status change of the bank branch as the Oracle did in phase 3.
	 * 			Dequeue this Request.
	 */
	private void run() {
		// TODO 
	}

	public static void main(String[] args) {
		new FailureDetectionVoter();
	}
}
